<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户主菜单</title>
    <link rel="stylesheet" type="text/css" href="../css/usermenu.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body style="background-color: #ffaa7f;">
<div id="user">
    <div class="menu">
        <div>
            <div class="title">
                <button style="width: 200px;font-size: 20px;" @click="pageLoad()" type="button">个人信息</button>
            </div>
        </div>
        <hr style="border: none;">
        <div>
            <div>
                <button style="width: 200px;font-size: 20px;" onclick="location.replace('expenseView.html');">报销查看
                </button>
            </div>
        </div>

    </div>
    <span>
	<table>
		<thead>
			<tr>
				<th>姓名</th>
				<th>医保卡号</th>
				<th>医保类别</th>
				<th>银行卡号</th>
				<th>身份证号</th>
				<th>手机号</th>
				<th>执行操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>{{param.insuranceName}}</td>
				<td>{{param.insuranceCode}}</td>
				<td>{{param.insuranceRole}}</td>
				<td>{{param.bankAccount}}</td>
				<td>{{param.idcard}}</td>
				<td>{{param.tel}}</td>
				<td>
					<button onclick="location.replace('userUpdate.html');">修改</button>
					
				</td>
			</tr>
		</tbody>
	</table>
	</span>
</div>
</div>
<script type="text/javascript" src="../js/axios.js"></script>
<script type="text/javascript" src="../js/vue.js"></script>
<script type="text/javascript" src="../js/message.js"></script>
<script>
    var vue = new Vue({
        el: "#user",
        data: {
            param: {
                "insuranceName": "",
                "insuranceCode": "",
                "insuranceRole": "",
                "bankAccount": "",
                "idcard": "",
                "tel": ""
            }
        },
        mounted: function () {
            this.pageLoad();
        },
        methods: {
            pageLoad: function () {
                console.log(sessionStorage.getItem("authtoken"));
                axios.post("http://localhost:8000/bracelet/release/api/pageLoad",
                    {
                        "token": sessionStorage.getItem("authtoken")
                    })
                    .then(res => {
                        this.param.insuranceName = res.data.result.insurance_name;
                        this.param.insuranceCode = res.data.result.insurance_code;
                        this.param.insuranceRole = res.data.result.name;
                        this.param.bankAccount = res.data.result.bank_account;
                        this.param.idcard = res.data.result.idcard;
                        this.param.tel = res.data.result.tel;

                    })
                    .catch(error => {
                        alert(error.errorMsg);
                    });
            }
        }
    });
</script>
</body>
</html>